Example: PLC Chat Net Base Services
Product: CODESYS Base Libraries
The sample project consists of a server application and a client application, each with a visualization. A client application communicates with another client application over the server application via TCP (Port 50000). The connection can be either encrypted or unencrypted.
Description
Establishing an unencrypted TCP connection
An unencrypted connection can be established by deactivating the 'Encrypted' switch. For the client application and server application, the IP address of the server has to be specified in the "IP address" field.
Establishing an encrypted TCP connection
An encrypted connection can be established by activating the "Encrypted" switch. In this case, the server has to have stored the client certificates as trusted certificates. The client applications each have to have stored the server certificate as trusted certificates.
Open the PLC Shell of the device (client and server)
Enter the following command:
cert-genselfsigned
Download and install the CODESYS Security Agent tool from the CODESYS Store International (see: https://store.code sys.com/codesys-security-agent.html).
Open the Security Screen view.
Select a specific certificate and save it to the PC.
Save the certificate of the client as a trusted certificate of the server.
Save each certificate of the server as a trusted certificate of the client.
In the
TCP_Client
andTCP_Server
programs, theinfo
variable has to be set to the name (CN) of the specified certificate.
The Go Online button can be used to activate the server and establish a connection between the clients and the server.
System requirements and restrictions
Programming system | CODESYS Development System (version 3.5.16.0 or higher) |
Runtime system | CODESYS Control Win (version 3.5.16.0) |
Add-on components | - |
Note
DOWNLOAD Project